<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>



    <script>
        // let arr = ['鸡你太美', 'ikun', '黑粉', '爱打篮球', '唱', '跳', 'rap']
        // let i = Math.floor(Math.random() * arr.length)
        // let name = arr[i]
        // console.log(arr[i]);
        // 升级版
        // let arr = ['鸡你太美', 'ikun', '黑粉', '爱打篮球', '唱', '跳', 'rap']
        // let i = Math.floor(Math.random() * arr.length)
        // document.write(arr[i])
        // // 删除中间数据 arr.splice(i, 1)   i下表选中 1代表一个
        // arr.splice(i, 1)
        // console.log(arr);
        let arr = ['鸡你太美', 'ikun', '黑粉', '爱打篮球', '唱', '跳', 'rap']
        // let i = Math.floor(Math.random() * arr.length)
        // document.write(arr[i])
        let i = Math.floor(Math.random() * arr.length)
        document.write(arr[i])

    </script>
</body>

</html>